package com.example.bookmall.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.bookmall.entity.Aftersales;
import com.example.bookmall.entity.PageResultVO;
import com.example.bookmall.entity.Result;
import com.example.bookmall.entity.order.*;

import java.util.List;
import java.util.Map;

public interface OrderService extends IService<Orders> {

    //创建订单
    Result createOrder(OrderSubmitDto orderSubmitDto);

    //修改订单状态
    Result UpdateOrderStatus(String orderId, Integer status);

    //获取所有订单
    Result<PageResultVO<OrderVo>> getAllOrder(Integer pageNum, Integer pageSize, String keyword, Integer status);

    //支付订单
    boolean payOrder(String orderId);

    //取消订单
    boolean cancelOrder(String orderId);


    Result<List<Orders>> getOrderById(Integer userId);

    ///获取订单详情 根据订单id
    OrderVo getOrderDetail(String orderId);

    //获取用户所有订单 的详情
    List<OrderVo> getOrderVoByUserId(Integer userId);

    //获取用户所有订单
    IPage<OrderVo> getOrderVoPage(Page<OrderVo> page,String keyword, Integer status);

    //修改订单地址
    Result UpdateOrderAddress(OrderDTO orderDTO);

    //删除订单根据订单号id
    Result deleteOrderById(String orderId);

    //批量删除订单
    Result batchDeleteOrders(List<String> ordeerIds);

    //获取退货结果 售后结果
    Result getretuResult(String orderId);

    //修改售后结果
    Result UpdateRetResult(Aftersales aftersales);


    //创建立即购买订单
    Result createOrderBuynow(Integer userId,OrderBuyNowDto orderBuyNowDto);


    //确认收货
    boolean receiptOrder(String orderId);



}
